<template>
    <div class="search-card">
        <el-card>
            <el-row :gutter="20" class="fnd-form">
                <el-col :span="8">
                    <el-row>
                        <el-col :lg="6" :xs="8" :md="10" class="font-right">报案号：</el-col>
                        <el-col :lg="18" :xs="16" :md="14">
                            <el-input size="mini" v-model="queryArr.notificationNo"></el-input>
                        </el-col>
                    </el-row>
                </el-col>
                <el-col :span="8">
                    <el-row>
                        <el-col :lg="6" :xs="8" :md="10" class="font-right">立案号：</el-col>
                        <el-col :lg="18" :xs="16" :md="14">
                            <el-input size="mini" v-model="queryArr.caseCreateNo"></el-input>
                        </el-col>
                    </el-row>
                </el-col>
                <el-col :span="8" v-if="isPolicyNo">
                    <el-row>
                        <el-col :lg="6" :xs="8" :md="10" class="font-right">保单号：</el-col>
                        <el-col :lg="18" :xs="16" :md="14">
                            <el-input size="mini" v-model="queryArr.policyNo"></el-input>
                        </el-col>
                    </el-row>
                </el-col>
                <el-col :span="8" :class="{'adjust-margin':isPolicyNo}">
                    <el-row>
                        <el-col :lg="6" :xs="8" :md="10" class="font-right">分公司：</el-col>
                        <el-col :lg="18" :xs="16" :md="14">
                            <el-select v-model="queryArr.branch" size="mini">
                                <el-option
                                        v-for="item in company"
                                        :key="item.branchCode"
                                        :label="item.branchName"
                                        :value="item.branchCode"
                                >
                                </el-option>
                            </el-select>
                        </el-col>
                    </el-row>
                </el-col>
                <el-col :span="8" class="adjust-margin">
                    <el-row>
                        <el-col :lg="6" :xs="8" :md="10" class="font-right">险种：</el-col>
                        <el-col :lg="18" :xs="16" :md="14">
                            <el-select v-model="queryArr.classCode" size="mini">
                                <el-option
                                        v-for="item in productType"
                                        :key="item.code"
                                        :label="item.name"
                                        :value="item.code"
                                >
                                </el-option>
                            </el-select>
                        </el-col>
                    </el-row>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="adjust-margin" style="text-align:right">
                <el-col :span="24">
                    <el-button type="primary" size="small" @click="reset()">重置</el-button>
                    <el-button type="primary" size="small" @click="query()">查询</el-button>
                </el-col>
            </el-row>
        </el-card>
    </div>
</template>

<script setup lang="ts">
    import {reactive,toRefs} from "vue"
    import { useDataStore } from '@/store/data';
    import {storeToRefs} from "pinia";
    const dataStore=useDataStore();
    const {menu,username,getMenu}=storeToRefs(dataStore)
    const props=defineProps({
        typeFlag:{
            type:String,
        },
        isPolicyNo:{
            type:Boolean,
            default:true
        }
    })
    const typeFlag=toRefs(props)
    const company=getMenu.value.company
    const productType=getMenu.value.productType
    const productList=getMenu.value.productList

    const queryArr=reactive({
        notificationNo:'',
        caseCreateNo:'',
        policyNo: '',
        branch: '',
        classCode: '',
        userCode:username.value,
        type:typeFlag,
        pageNum: 1
    })
    defineExpose({
        queryArr
    })
</script>

<style scoped>

</style>
